<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<h1>文件上传</h1>
<form action="">
  <input type="text" name="info" placeholder="说点儿什么"><br>
  <input type="file" name="picFile"><br>
  <input type="button" value="上传文件" @click="upload()">
</form>
<a href="/list.html">列表页面</a>
<!--引入axios和vue-->
<script src="https://cdn.bootcdn.net/ajax/libs/axios/0.21.1/axios.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
<script>
  let v = new Vue({
    el:"form",
    data:{},
    methods:{
      upload:function (){
        //得到formbiaodanlimiandeshuju
        let data = new FormData(document.querySelector("form"));
        axios.post("/upload",data).then(function () {
          alert("上传完成!");
        })
      }
    }
  })
</script>
</body>
</html>